package com.pj.exception;

import com.pj.common.ResultCode;
import com.pj.common.ResultVO;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ExceptionControllerAdvice {

    @ExceptionHandler(APIException.class)
    public ResultVO<String> doAPIException(APIException e) {
        return new ResultVO<>(ResultCode.FAILED, e.getMsg());
    }
}
